Dectect if cups allows access to the http_t authstring field.
authorMatthias Clasen <mclasen@redhat.com>
Mon, 23 Jul 2007 17:02:04 +0000 (17:02 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 23 Jul 2007 17:02:04 +0000 (17:02 +0000)
2007-07-23  Matthias Clasen  <mclasen@redhat.com>

        * configure.in: Dectect if cups allows access to the http_t
        authstring field.

        * modules/printbackends/cups/gtkcupsutils.c: Rely on the
        HAVE_HTTP_AUTHSTRING define done by configure.

svn path=/trunk/; revision=18527

ChangeLog
configure.in
modules/printbackends/cups/gtkcupsutils.c

index 2e0acea4607ff48a0c98923a7bce5228006b26b1..c6fc2c2729c042cf33913b49a9bded9e66680cf6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-07-23  Matthias Clasen  <mclasen@redhat.com>
+
+       * configure.in: Dectect if cups allows access to the http_t
+       authstring field.  
+
+       * modules/printbackends/cups/gtkcupsutils.c: Rely on the
+       HAVE_HTTP_AUTHSTRING define done by configure.
+
 2007-07-23  Emmanuele Bassi  <ebassi@gnome.org>
 
        * gtk/gtkrecentchooserdefault.c: Port the GtkRecentChooser default
index ba88e887a86cc1fa23fca65b64cdcb8f62908046..1230f38ad06d3140df74b85d537c5332f480f131 100644 (file)
@@ -1572,6 +1572,15 @@ if test "x$CUPS_CONFIG" != "xno"; then
 fi
 AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno")
 
+gtk_save_cflags="$CFLAGS"
+CFLAGS="$CUPS_CFLAGS"
+AC_TRY_COMPILE([#include <cups/http.h>],
+               [http_t http; char *s = http.authstring;],
+               [AC_DEFINE(HAVE_HTTP_AUTHSTRING,[],[Define if cups http_t authstring field is accessible])],)
+CFLAGS="$gtk_save_cflags"
+
+AC_SUBST(HAVE_HTTP_AUTHSTRING)
+
 gtk_save_cppflags="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS"
                          
index faf369347ab9a73287ab48d1fc3abaaa9cf5dfe2..32d433f1fe9bcbfd5138ee18a24b40325c35004a 100644 (file)
 #include <stdlib.h>
 #include <time.h>
 
-#if CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR > 1) || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR == 1 && CUPS_VERSION_PATCH >= 20)
-#define HAVE_HTTP_AUTHSTRING 1
-#endif
-
 typedef void (*GtkCupsRequestStateFunc) (GtkCupsRequest *request);
 
 static void _connect            (GtkCupsRequest *request);